# Maintainer: Gennady Feldman <gena01@gmail.com>
# Contributor: Gennady Feldman <gena01@gmail.com>
# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-fastavro
_pkgname=fastavro
pkgver=1.5.2
pkgrel=0
pkgdesc="Fast Avro for Python"
# Tests for optional zstd and snappy codecs require
# unpackaged python modules 'zstandard' and 'python-snappy'
options="!check"
url="https://github.com/fastavro/fastavro"
arch="all !x86" # _tz_ tests fail
license="MIT"
depends="py3-six"
makedepends="py3-setuptools python3-dev cython"
checkdepends="py3-pytest py3-numpy"
source="$pkgname-$pkgver.tar.gz::https://github.com/fastavro/fastavro/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	FASTAVRO_USE_CYTHON=1 python3 setup.py build
}

check() {
	PYTHONPATH="$(echo $PWD/build/lib.*)" python3 -m pytest -v tests
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
f1b831dfb82bcfc52be360f5eedea940b1514bf078e93a3545f9d6030ffc5b9d6899a8e58f096def42f0e3c52cca354b7a3f39ab7d4e23483cb763f234da2a79  py3-fastavro-1.5.2.tar.gz
"
